import service from '@/utils/request'

export const useWaybillApi = (id: number) => {
  return service.get('/biz/waybill/' + id)
}

export const useWaybillSubmitApi = (dataForm: any) => {
  if (dataForm.id) {
    return service.put('/biz/waybill', dataForm)
  } else {
    return service.post('/biz/waybill', dataForm)
  }
}

export function useAlarmDataApi(data) {
  return service.get('/gps/alarm/alarms', {
    params: data
  })
}

export function useGetWaybillList(data) {
  return service.get('/biz/waybill/page', {
    params: data
  })
}

export function disuseApi(id) {
  return service.put('biz/waybill/abandoned', { id })
}
